Repository navigation
[PM-47415] fix: Initialize shared flows once instead of in property getters - #7638
Open
merrick-cr wants to merge 1 commit into
Open
merrick-cr wants to merge 1 commit into
merrick-cr wants to merge 1 commit into
Conversation
…tters Convert getters that call stateIn/shareIn into single property initializers to satisfy NoSharingInPropertyGetter. Rework vaultLastSyncStateFlow to follow the active user, make isActiveUserUnlockingFlow eager, and update tests that relied on per-access flows.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7638 +/- ##
===========================================
+ Coverage 69.22% 86.96% +17.74%
===========================================
Files 898 897 -1
Lines 65001 65272 +271
Branches 9320 9402 +82
===========================================
+ Hits 44994 56765 +11771
+ Misses 17482 5036 -12446
- Partials 2525 3471 +946
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
PM-47415
📔 Objective
Fixes the 25 existing
NoSharingInPropertyGetterdetekt violations (rule added in #7615) inapp,authenticatoranddata. Each was a property getter callingstateIn, so every access built a new shared flow and launched a new collector.SettingsRepositoryImpl.vaultLastSyncStateFlowused to be rebuilt for whichever user was active at access time. It now followsactiveUserIdChangesFlowwithflatMapLatest, so it tracks user switches and emitsnullwhen there is no active user.VaultLockManagerImpl.isActiveUserUnlockingFlowchanged fromLazilytoEagerly.UserStateManagerImplreads its.valuewithout a guaranteed collector, and a singleLazilyinstance would stay frozen at its construction-time value.FirstTimeActionManagerImpl.allSettingsBadgeCountFlowmoved below the flows it combines, since initializers run in declaration order.SettingsRepositoryTeststubs every flow collected at construction,FlightRecorderManagerTest,UserNotificationPolicyManagerTest). Added tests forvaultLastSyncStateFlowfollowing the active user and for each shared flow returning the same instance on every access.Detekt is clean and the unit tests pass for the affected app, authenticator and data suites.
📸 Screenshots
Not applicable, no UI changes.